<template>
  <div>
    <div class="icon-selector" :class="isActive" @click.stop="backColorActive">
      <img src="~/assets/images/cart/tick.svg" alt="">
    </div>
  </div>
</template>

<script>
  export default {
    name: "CheckButton",
    props: {
      checked: {
        type: Array,
        default(){
          return [];
        }
      }
    },
    computed: {
      isActive(){
        return {"backColor": this.checked[0]};
      }
    },
    methods: {
      backColorActive(){
        this.$emit("backColorClick",{
          checked: this.checked[0],
          index: this.checked[1]
        });
      }
    }
  };
</script>

<style scoped>
  .icon-selector {
    position: relative;
    margin: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
  }

  .backColor {
    background-color: #ff8198;
    border-color: #ff8198;
  }
</style>